#ifndef _USER_H
#define _USER_H
#include<iostream>
#include <QHostAddress>
#include<cstring>
#include<vector>
using namespace std;
//static int count=0;
class user
{
public:
    int count=0;
    user(QString id, QString name,QString password):
        id(id),name(name),password(password)
    {
        //count++;
        qDebug()<<"Construct a new member";
    }
    user(){}
    QString getUserName()
    {
        return this->name;
    };
    QString getUserId()
    {
        return this->id;
    };
    QString getUserGender()
    {
        return this->gender;
    }
    QString getUserGenderInChinese()
    {
        if (this->gender == "0") { return "女"; }
        else if (this->gender == "1") { return "男"; }
        else { return ""; }
    }
    QString getUserPassword()
    {
        return this->password;
    }
    QString getUserPhoto()
    {
        return this->photo;
    }
    void setUserName(QString name)
    {
        this->name=name;
    }
    void setUserPassword(QString password)
    {
        this->password=password;
    }
    void setUserId(QString id)
    {
        this->id=id;
    }
    void setUserGender(QString gender)
    {
        this->gender=gender;
    }
    ~user()
    {
        qDebug()<<"Destructing user";
    }
    friend class LogOnWidget;
    friend class MainInterfaceWidget;
    friend class addfriendreceiver;
    friend class addfriendsearch;
    friend class addfriendsender;
    /*
    void addFriend(QString fname);
    bool findFriend(QString fname);//判断是否存在该朋友
    void deleteFriend(QString fname);//删除好友
    */
private:
    QString id;
    QString name;
    QString password;
    QString qq;
    QString gender;//性别 0为女，1为男, 2默认
    QString email;
    QString photo;
    QString friendlist;//每个朋友只存储id 不同朋友用空格间隔
};

struct UserBrief
{
    QString id;
    QString username;
    QString photo;
    QString gender;

};

struct UserChange
{
    QString username;
    QString password;
    QString photo;
    //QString gender;

};

#endif
